<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="/admin/css/pintuer.css">
<link rel="stylesheet" href="/admin/css/admin.css">
<script src="/admin/js/jquery.js"></script>
<script src="/admin/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel margin-top">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>修改栏目</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{{url('admin_cat/edit')}}">
  {!!csrf_field()!!}
  @if($cats->parentid !== 0)
      <div class="form-group">
        <div class="label">
          <label>上级栏目：</label>
        </div>
        <div class="field">
          <select name="parentid" class="input w50">
          @foreach($catlist as $c)
           @if($cats->parentid == $c->cat_id)
            <option value="{{$c->cat_id}}">
              {{$c->cat_name}}
              @endif
              @endforeach
            </option>
            @foreach($catlist as $list)
             @if($list->parentid == 0 and $cats->parentid !== 0 and $list->cat_id !== $cats->parentid)
            <option value="{{$list->cat_id}}">  
              {{$list->cat_name}}
            </option>
             @endif
            @endforeach
          </select>
          <div class="tips">不选择上级栏目默认为原栏目</div>
        </div>
      </div>
@endif

      <div class="form-group">
        <div class="label">
          <label>栏目名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="cat_name" value="{{$cats->cat_name}}" />
          <input type='hidden' name='cat_id' value="{{$cats->cat_id}}" />
          <div class="tips"></div>
        </div>
      </div>

      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body></html>
